<?php
namespace app\index\controller\shopro;
use app\common\controller\Frontend;
class Index extends Frontend{
    protected $noNeedLogin = '*';
    protected $noNeedRight = '*';
    protected $layout = 'article';
    public function protocol(){
        $type = $this->request->param('type');
        $configModel = new \addons\shopro\model\Config;
        $config = $configModel->where('name', 'shopro')->value('value');
        $shoproConfig = json_decode($config, true);
        $richTextId = $shoproConfig[$type];
        $data = \addons\shopro\model\Richtext::get(['id' => $richTextId]);
        $this->assign('title',$data->title);
        return $this->assign('content',$data)->fetch();
    }
}